package com.Eastiy.EXO.View;

import android.content.Context;
import android.view.MotionEvent;
import android.view.View;

public class PromptBox {
    /* access modifiers changed from: private */
    public static NewCDV PromptBoxCDV;
    /* access modifiers changed from: private */
    public static NewView _pb7;
    private static NewView _pb8;
    /* access modifiers changed from: private */
    public static NewView _pb9;
    private static int clo;
    public static Context context;
    private static NewView pb0;
    private static NewView pb1;
    private static NewView pb2;
    private static NewView pb3;
    private static NewViewSV pb4;
    private static NewView pb5;
    private static NewView pb6;
    private static NewView pb7;
    private static NewView pb9;
    private static NewText pt1;
    private static NewText pt2;
    private static NewText pt3;
    private static NewText pt4;
    private static double size;

    /* renamed from: H */
    private static int m38H() {
        return context.getResources().getDisplayMetrics().heightPixels;
    }

    /* renamed from: W */
    private static int m39W() {
        return context.getResources().getDisplayMetrics().widthPixels;
    }

    public static void dis() {
        PromptBoxCDV.dismiss();
    }

    public static void show(Context context2, Object obj, String str, String[] strArr, Object[] objArr, Object[] objArr2, Object[] objArr3) {
        context = context2;
        if (obj == "small") {
            size = 0.6d;
        } else if (obj == "medium") {
            size = 0.8d;
        } else if (obj == "large") {
            size = (double) 1;
        }
        if (objArr != null) {
            clo = 1;
        }
        if (!(objArr == null || objArr2 == null)) {
            clo = 2;
        }
        pb0 = new NewView(context2, new Integer(-1), new Integer(-1), "CC", new Integer(1), 2, (Object) null, (Object) null, (View.OnClickListener) null);
        pb1 = new NewView(context2, new Integer((int) (((double) m39W()) * 0.7d * size)), new Integer((int) (((double) m38H()) * 0.8d * size)), "CC", new Integer(1), 1, "#fffafafa", new Integer(10), (View.OnClickListener) null);
        pb2 = new NewView(context2, new Integer((int) (((double) m39W()) * 0.65d * size)), new Integer((int) (((double) m38H()) * 0.15d)), "LC", new Integer(1), 1, "#00FFFFFF", new int[]{10, 10, 0, 0}, (View.OnClickListener) null);
        pb3 = new NewView(context2, new Integer((int) (((double) m39W()) * 0.65d * size)), new Integer((((int) (((double) m38H()) * 0.8d)) * ((int) size)) - ((int) (((double) m38H()) * 0.25d))), "CC", new Integer(1), 2, (Object) null, (Object) null, (View.OnClickListener) null);
        pb4 = new NewViewSV(context2, new Integer((int) (((double) m39W()) * 0.65d * size)), new Integer((int) (((((double) m38H()) * 0.8d) * size) - (((double) m38H()) * 0.25d))), new Integer(2), (Object) null, (Object) null);
        pb4.setScrollBarDefaultDelayBeforeFade(100);
        pb4.setScrollBarFadeDuration(100);
        pb5 = new NewView(context2, new Integer(((int) (((double) m39W()) * 0.65d)) * ((int) size)), new Integer((((int) (((double) m38H()) * 0.8d)) * ((int) size)) - ((int) (((double) m38H()) * 0.25d))), "CC", new Integer(1), 2, (Object) null, (Object) null, (View.OnClickListener) null);
        pb6 = new NewView(context2, new Integer(((int) (((double) m39W()) * 0.7d)) * ((int) size)), new Integer((int) (((double) m38H()) * 0.1d)), "CC", new Integer(0), 1, "#00FFFFFF", new int[]{0, 0, 10, 10}, (View.OnClickListener) null);
        if (clo == 1) {
            pb7 = new NewView(context2, new Integer((int) ((((((double) m39W()) * 0.7d) * size) / ((double) clo)) - (((double) m39W()) * 5.0E-4d))), new Integer((int) (((double) m38H()) * 0.1d)), "CC", new Integer(1), 2, (Object) null, (Object) null, (View.OnClickListener) null);
            _pb7 = new NewView(context2, new Integer((int) (((((((double) m39W()) * 0.7d) * size) / ((double) clo)) - (((double) m39W()) * 5.0E-4d)) * 0.7d)), new Integer((int) (((double) m38H()) * 0.07d)), "CC", new Integer(1), 1, "#fffafafa", new Integer(10), new View.OnClickListener(objArr) {
                private final Object[] val$clo1;

                {
                    this.val$clo1 = r1;
                }

                @Override
                public void onClick(View view) {
                    if (this.val$clo1[1] != null) {
                        ((View.OnClickListener) this.val$clo1[1]).onClick(view);
                    }
                    if (this.val$clo1[2] != null) {
                        PromptBox.PromptBoxCDV.dismiss();
                    }
                }
            });
            _pb7.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View view, MotionEvent motionEvent) {
                    switch (motionEvent.getAction()) {
                        case 0:
                            view.setBackgroundDrawable(ASUI.roundBG("#fff0f0f0", new Integer(10), (String) null, (Object) null));
                            return false;
                        case 1:
                            view.setBackgroundDrawable(ASUI.roundBG("#fffafafa", new Integer(10), (String) null, (Object) null));
                            return false;
                        default:
                            return false;
                    }
                }
            });
        } else if (clo == 2) {
            pb7 = new NewView(context2, new Integer((int) ((((((double) m39W()) * 0.7d) * size) / ((double) clo)) - (((double) m39W()) * 5.0E-4d))), new Integer((int) (((double) m38H()) * 0.1d)), "CC", new Integer(1), 2, (Object) null, (Object) null, (View.OnClickListener) null);
            _pb7 = new NewView(context2, new Integer((int) (((((((double) m39W()) * 0.7d) * size) / ((double) clo)) - (((double) m39W()) * 5.0E-4d)) * 0.7d)), new Integer((int) (((double) m38H()) * 0.07d)), "CC", new Integer(1), 1, "#fffafafa", new Integer(10), new View.OnClickListener(objArr) {
                private final Object[] val$clo1;

                {
                    this.val$clo1 = r1;
                }

                @Override
                public void onClick(View view) {
                    ((View.OnClickListener) this.val$clo1[1]).onClick(view);
                    if (this.val$clo1[2] != null) {
                        PromptBox.PromptBoxCDV.dismiss();
                    }
                }
            });
            _pb7.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View view, MotionEvent motionEvent) {
                    switch (motionEvent.getAction()) {
                        case 0:
                            PromptBox._pb7.setBackgroundDrawable(ASUI.roundBG("#fff0f0f0", new Integer(10), (String) null, (Object) null));
                            return false;
                        case 1:
                            PromptBox._pb7.setBackgroundDrawable(ASUI.roundBG("#fffafafa", new Integer(10), (String) null, (Object) null));
                            return false;
                        default:
                            return false;
                    }
                }
            });
            _pb8 = new NewView(context2, new Integer((int) (((double) m39W()) * 0.001d)), new Integer((int) (((double) m38H()) * 0.05d)), "CC", new Integer(1), 1, "#ff808080", new Integer(0), (View.OnClickListener) null);
            pb9 = new NewView(context2, new Integer((int) ((((((double) m39W()) * 0.7d) * size) / ((double) clo)) - (((double) m39W()) * 5.0E-4d))), new Integer((int) (((double) m38H()) * 0.1d)), "CC", new Integer(1), 2, (Object) null, (Object) null, (View.OnClickListener) null);
            _pb9 = new NewView(context2, new Integer((int) (((((((double) m39W()) * 0.7d) * size) / ((double) clo)) - (((double) m39W()) * 5.0E-4d)) * 0.7d)), new Integer((int) (((double) m38H()) * 0.07d)), "CC", new Integer(1), 1, "#fffafafa", new Integer(10), new View.OnClickListener(objArr2) {
                private final Object[] val$clo2;

                {
                    this.val$clo2 = r1;
                }

                @Override
                public void onClick(View view) {
                    ((View.OnClickListener) this.val$clo2[1]).onClick(view);
                    if (this.val$clo2[2] != null) {
                        PromptBox.PromptBoxCDV.dismiss();
                    }
                }
            });
            _pb9.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View view, MotionEvent motionEvent) {
                    switch (motionEvent.getAction()) {
                        case 0:
                            PromptBox._pb9.setBackgroundDrawable(ASUI.roundBG("#fff0f0f0", new Integer(10), (String) null, (Object) null));
                            return false;
                        case 1:
                            PromptBox._pb9.setBackgroundDrawable(ASUI.roundBG("#fffafafa", new Integer(10), (String) null, (Object) null));
                            return false;
                        default:
                            return false;
                    }
                }
            });
        }
        pt1 = new NewText(context2, ASUI.FontColor(new StringBuffer().append("§l").append(str).toString()), "LC", 18, "#000000");
        if (clo == 1) {
            pt2 = new NewText(context2, ASUI.FontColor(new StringBuffer().append("§l").append(objArr[0].toString()).toString()), "CC", 15, "#000000");
        }
        if (clo == 2) {
            pt2 = new NewText(context2, ASUI.FontColor(new StringBuffer().append("§l").append(objArr[0].toString()).toString()), "CC", 15, "#000000");
            pt3 = new NewText(context2, ASUI.FontColor(new StringBuffer().append("§l").append(objArr2[0].toString()).toString()), "CC", 15, "#000000");
        }
        if (strArr != null) {
            String str2 = "";
            for (String append : strArr) {
                str2 = new StringBuffer().append(new StringBuffer().append(str2).append(append).toString()).append("\n").toString();
            }
            pt4 = new NewText(context2, ASUI.FontColor(str2), "LC", 14, "#000000");
        }
        pb0.addView(pb1);
        pb1.addView(pb2);
        pb2.addView(pt1);
        pb1.addView(pb3);
        pb3.addView(pb4);
        pb4.addView(pb5);
        if (strArr != null) {
            pb5.addView(pt4);
        }
        if (objArr3 != null) {
            int i = 0;
            while (true) {
                int i2 = i;
                if (i2 >= objArr3.length) {
                    break;
                }
                if (objArr3[i2] != null) {
                    pb5.addView(objArr3[i2]);
                }
                i = i2 + 1;
            }
        }
        pb1.addView(pb6);
        if (clo == 1) {
            pb6.addView(pb7);
            pb7.addView(_pb7);
            _pb7.addView(pt2);
        } else if (clo == 2) {
            pb6.addView(pb7);
            pb7.addView(_pb7);
            _pb7.addView(pt2);
            pb6.addView(_pb8);
            pb6.addView(pb9);
            pb9.addView(_pb9);
            _pb9.addView(pt3);
        }
        PromptBoxCDV = new NewCDV(pb0, new Integer(-1), new Integer(-1), false, true, false, "CC", "Tr", 0, 0);
    }
}
